home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1999 March / EnigmA AMIGA RUN 35 (1999)(G.R. Edizioni)(IT)[!][issue 1999-03].iso / earcd / devel / wild / appunti / loader.txt < prev    next >
Text File  |  1999-01-01  |  3KB  |  79 lines

  1. Loader module design.
  2.  
  3. It's a new king of module, the only special thing is that you cannot modify it via 
  4. prefs editing, because only the app selects his loader. So, no type needed, because
  5. the app selects his filetype, loading the ok module. No optimized versions for cpu
  6. are needed, because a loader has only to be robust and easy to port/rewrite: not to
  7. be fast!
  8.  
  9. Loader module funcs:
  10. STD module funcs: the unused ones are RESERVED, now pointed to a rts).
  11.  
  12. LoadLevel(tags)         returns a LEVEL struct.
  13. LoadAlien(tags)         used to load SuperAliens (player...)
  14. (Re)LoadTexture(tags)   used to re-load the textures.
  15.  
  16. More: the RefreshModule does the level-loading, if changed.
  17.  
  18. NO! Everything Changed, new ideas !
  19. New concepts...
  20.  
  21. WildBuild function made.
  22.  
  23. the LoadWildObject func will be manager hi-level by wild, and low-level by loader
  24. modules.
  25.  
  26. So, the app will ask to wild: LoadWildObject(): load me an alien from this file, 
  27. position it in a position, link it to that... so, LoadWildObject will first
  28. load the object's attributes, then will call the WildBuild func to build it,
  29. using also the tags given by the app (the parent,... wich are not defined in the
  30. file.)
  31.  
  32. The LoadWildObject will call the LoaderModule, and can ask:
  33.  
  34. LoadObject(...): loads an object from a file, a ???, decided via tags. This object
  35.                  is keeped in memory in the Module's format.
  36.  
  37. GetObjectAttr(obj,attr,default):
  38.                     asks to the loader an attribute of an object. May ask a value, like
  39.                     the object's color, or the object's position, NOT object's childs.
  40.                     Links to other friend objects are considered like attrs.
  41.                     If the attr is not supported, always return 0!
  42.                     NOTE: The loader must KNOW the type of the object passed!
  43.                     nOTE: The loader must give also the sub-attrs: explain better:
  44.                           an ARENA also have all ALIEN's attrs, and an ALIEN has also
  45.                           all the ENTITY attrs,...
  46.  
  47. NextObjectChild(obj,prec,childtype): asks to the loader the next child of the object. Every time, you
  48.                       pass the precedent object (or NULL at start) and that will find
  49.                       for you the next child. May even ask for a specific type of child.
  50.  
  51. FreeObject(...): passes the object, and the module has to free all what it made for that,
  52.                  even tmp data or what else. A Pool use is HIGHLY recommenced: it's very
  53.                  secure, less memory frag, no forget pieces of mem...
  54.  
  55. MadeObjectIs(obj,defobj): passes the made (wild format) object, and the Loader's format
  56.                           object. Needed to have a pointer to an already made alien, for
  57.                           example when you made all the aliens you can set the World's
  58.                           Player, but not before ! So, the Loader must know the location
  59.                           of the made player to say you.
  60.  
  61. BUT: Any kind of loaded must respect this tree, or a sub-part of it:
  62.  
  63. Level
  64. #
  65. |-Scene
  66. | #Camera
  67. | #Palette
  68. | |
  69. | |-World
  70. | | #Player
  71. | | #
  72.  
  73.  
  74.  
  75.  
  76.  
  77.  
  78.                     
  79.